package org.genntii.warehousesystem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.genntii.warehousesystem.domain.entity.City;

import java.util.List;

@Mapper
public interface CityMapper extends BaseMapper<City> {

    @Select("select city from city where id = #{id}")
    String findCity(@Param("id")int id);

    @Select("select province_id from city where id=#{id}")
    int findProvinceId(@Param("id")int id);

    @Select("select id from city where province_id = #{id}")
    List<Integer> findCities(@Param("id")int id);

}
